<?php
	require_once('sdb.php');

	//
	// TODO Get our key and secret from EC2 user data
	//
	$key = "YOUR KEY";
	$secret = "YOUR SECRET";

	$sdb = new SimpleDB($key, $secret, false);

	//
	// We look for this function everywhere so we will define it here
	//
	if (!function_exists("GetSQLValueString"))
	{
		function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
		{
  			$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  			$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

			switch ($theType)
			{
    			case "text":
      				$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      				break;
			    case "long":
			    case "int":
			      	$theValue = ($theValue != "") ? intval($theValue) : "NULL";
			      	break;
			    case "double":
					$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
			      	break;
			    case "date":
			      	$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
			      	break;
			    case "defined":
			      	$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
			      	break;
  			}

  			return $theValue;
		}
	}
?>